{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1f173bce",
   "metadata": {},
   "source": [
    "# week2\n",
    "了解python和idle窗口"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6de3826",
   "metadata": {},
   "source": [
    "# 变量：用于储存要在计算机程序中引用和操作的信息\n",
    "定义：\n",
    "1.变量是字母，数字和下划线任意组合\n",
    "2.第一个字符不能是数字\n",
    "3.关键字不能作为变量['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda','not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']\n",
    "\n",
    "变量的赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5f27f74b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Zhichao Zhichao\n",
      "What is the value of name2 now?\n"
     ]
    }
   ],
   "source": [
    "name = \"Zhichao\"\n",
    "\n",
    "name2 = name\n",
    "\n",
    "print(name,name2)\n",
    "\n",
    "name = \"Han-Teng\"\n",
    "\n",
    "print(\"What is the value of name2 now?\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7fd05f38",
   "metadata": {},
   "source": [
    "# 第一章代码（奇数的指定时间）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "521841c6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "odds = [1,  3,  5,  7,  9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59]\n",
    "right_this_minute = datetime.today().minute\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3212cee6",
   "metadata": {},
   "source": [
    "# 4.函数+模块=标准库\n",
    "观察标准库（python的标准库丰富，提供了大量可重用代码）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "46ebe8fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'win32'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入需要的模块，然后访问属性\n",
    "\n",
    "import sys\n",
    "sys.platform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ac5a794e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]\n"
     ]
    }
   ],
   "source": [
    "#python版本信息\n",
    "\n",
    "print(sys.version)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "b3cbf7f1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Lenovo'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "##os模块：导入模板，再调函数\n",
    "#getcwd得到的文件夹位置\n",
    "\n",
    "import os\n",
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "dfb1dd86",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "environ{'ALLUSERSPROFILE': 'C:\\\\ProgramData',\n",
       "        'APPDATA': 'C:\\\\Users\\\\Lenovo\\\\AppData\\\\Roaming',\n",
       "        'COMMONPROGRAMFILES': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files',\n",
       "        'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMPUTERNAME': 'LAPTOP-TOBO42GK',\n",
       "        'COMSPEC': 'C:\\\\WINDOWS\\\\system32\\\\cmd.exe',\n",
       "        'DRIVERDATA': 'C:\\\\Windows\\\\System32\\\\Drivers\\\\DriverData',\n",
       "        'HOMEDRIVE': 'C:',\n",
       "        'HOMEPATH': '\\\\Users\\\\Lenovo',\n",
       "        'LOCALAPPDATA': 'C:\\\\Users\\\\Lenovo\\\\AppData\\\\Local',\n",
       "        'LOGONSERVER': '\\\\\\\\LAPTOP-TOBO42GK',\n",
       "        'NUMBER_OF_PROCESSORS': '12',\n",
       "        'ONEDRIVE': 'C:\\\\Users\\\\Lenovo\\\\OneDrive',\n",
       "        'ONEDRIVECONSUMER': 'C:\\\\Users\\\\Lenovo\\\\OneDrive',\n",
       "        'OS': 'Windows_NT',\n",
       "        'PATH': 'C:\\\\ProgramData\\\\Anaconda3;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\mingw-w64\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\usr\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Scripts;C:\\\\WINDOWS\\\\system32;C:\\\\WINDOWS;C:\\\\WINDOWS\\\\System32\\\\Wbem;C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\WINDOWS\\\\System32\\\\OpenSSH\\\\;C:\\\\Program Files\\\\PuTTY\\\\;C:\\\\Users\\\\Lenovo\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;;C:\\\\Program Files\\\\JetBrains\\\\PyCharm 2021.2.1\\\\bin;',\n",
       "        'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',\n",
       "        'PROCESSOR_ARCHITECTURE': 'AMD64',\n",
       "        'PROCESSOR_IDENTIFIER': 'AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD',\n",
       "        'PROCESSOR_LEVEL': '23',\n",
       "        'PROCESSOR_REVISION': '6001',\n",
       "        'PROGRAMDATA': 'C:\\\\ProgramData',\n",
       "        'PROGRAMFILES': 'C:\\\\Program Files',\n",
       "        'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)',\n",
       "        'PROGRAMW6432': 'C:\\\\Program Files',\n",
       "        'PROMPT': '$P$G',\n",
       "        'PSMODULEPATH': 'C:\\\\Program Files\\\\WindowsPowerShell\\\\Modules;C:\\\\WINDOWS\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules',\n",
       "        'PUBLIC': 'C:\\\\Users\\\\Public',\n",
       "        'PYCHARM': 'C:\\\\Program Files\\\\JetBrains\\\\PyCharm 2021.2.1\\\\bin;',\n",
       "        'SESSIONNAME': 'Console',\n",
       "        'SYSTEMDRIVE': 'C:',\n",
       "        'SYSTEMROOT': 'C:\\\\WINDOWS',\n",
       "        'TEMP': 'C:\\\\Users\\\\Lenovo\\\\AppData\\\\Local\\\\Temp',\n",
       "        'TMP': 'C:\\\\Users\\\\Lenovo\\\\AppData\\\\Local\\\\Temp',\n",
       "        'USERDOMAIN': 'LAPTOP-TOBO42GK',\n",
       "        'USERDOMAIN_ROAMINGPROFILE': 'LAPTOP-TOBO42GK',\n",
       "        'USERNAME': 'Lenovo',\n",
       "        'USERPROFILE': 'C:\\\\Users\\\\Lenovo',\n",
       "        'WINDIR': 'C:\\\\WINDOWS',\n",
       "        'JPY_INTERRUPT_EVENT': '2212',\n",
       "        'IPY_INTERRUPT_EVENT': '2212',\n",
       "        'JPY_PARENT_PID': '2420',\n",
       "        'TERM': 'xterm-color',\n",
       "        'CLICOLOR': '1',\n",
       "        'PAGER': 'cat',\n",
       "        'GIT_PAGER': 'cat',\n",
       "        'MPLBACKEND': 'module://ipykernel.pylab.backend_inline'}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#系统的全部环境变量\n",
    "\n",
    "os.environ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "df37b0e2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#系统内一个环境变量\n",
    "\n",
    "os.getenv(\"homedrive\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "37693085",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2021, 10, 13)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "##datetime模块：\n",
    "\n",
    "import datetime\n",
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "97bfa50a",
   "metadata": {},
   "source": [
    "# 循环嵌套"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "01380a8c",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'today' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-14-4bdfefc70e8a>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Saturday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m    \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Party!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Sunday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m    \u001b[1;32mif\u001b[0m \u001b[0mcondition\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Headache\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m        \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Recover,then rest.\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'today' is not defined"
     ]
    }
   ],
   "source": [
    " if today == \"Saturday\":\n",
    "    print(\"Party!\")\n",
    "elif today == \"Sunday\":\n",
    "    if condition == \"Headache\":\n",
    "        print(\"Recover,then rest.\")\n",
    "    else:\n",
    "        print(\"Rest.\")\n",
    "else:\n",
    "    print(\"Work,work,work.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2f96f42",
   "metadata": {},
   "source": [
    "# 啤酒瓶代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "5bb63a73",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 botttles of beer on the wall.\n",
      "99 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "98 botttles of beer on the wall.\n",
      "98 botttles of beer on the wall.\n",
      "98 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "97 botttles of beer on the wall.\n",
      "97 botttles of beer on the wall.\n",
      "97 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "96 botttles of beer on the wall.\n",
      "96 botttles of beer on the wall.\n",
      "96 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "95 botttles of beer on the wall.\n",
      "95 botttles of beer on the wall.\n",
      "95 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "94 botttles of beer on the wall.\n",
      "94 botttles of beer on the wall.\n",
      "94 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "93 botttles of beer on the wall.\n",
      "93 botttles of beer on the wall.\n",
      "93 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "92 botttles of beer on the wall.\n",
      "92 botttles of beer on the wall.\n",
      "92 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "91 botttles of beer on the wall.\n",
      "91 botttles of beer on the wall.\n",
      "91 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "90 botttles of beer on the wall.\n",
      "90 botttles of beer on the wall.\n",
      "90 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "89 botttles of beer on the wall.\n",
      "89 botttles of beer on the wall.\n",
      "89 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "88 botttles of beer on the wall.\n",
      "88 botttles of beer on the wall.\n",
      "88 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "87 botttles of beer on the wall.\n",
      "87 botttles of beer on the wall.\n",
      "87 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "86 botttles of beer on the wall.\n",
      "86 botttles of beer on the wall.\n",
      "86 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "85 botttles of beer on the wall.\n",
      "85 botttles of beer on the wall.\n",
      "85 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "84 botttles of beer on the wall.\n",
      "84 botttles of beer on the wall.\n",
      "84 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "83 botttles of beer on the wall.\n",
      "83 botttles of beer on the wall.\n",
      "83 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "82 botttles of beer on the wall.\n",
      "82 botttles of beer on the wall.\n",
      "82 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "81 botttles of beer on the wall.\n",
      "81 botttles of beer on the wall.\n",
      "81 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "80 botttles of beer on the wall.\n",
      "80 botttles of beer on the wall.\n",
      "80 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "79 botttles of beer on the wall.\n",
      "79 botttles of beer on the wall.\n",
      "79 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "78 botttles of beer on the wall.\n",
      "78 botttles of beer on the wall.\n",
      "78 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "77 botttles of beer on the wall.\n",
      "77 botttles of beer on the wall.\n",
      "77 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "76 botttles of beer on the wall.\n",
      "76 botttles of beer on the wall.\n",
      "76 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "75 botttles of beer on the wall.\n",
      "75 botttles of beer on the wall.\n",
      "75 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "74 botttles of beer on the wall.\n",
      "74 botttles of beer on the wall.\n",
      "74 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "73 botttles of beer on the wall.\n",
      "73 botttles of beer on the wall.\n",
      "73 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "72 botttles of beer on the wall.\n",
      "72 botttles of beer on the wall.\n",
      "72 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "71 botttles of beer on the wall.\n",
      "71 botttles of beer on the wall.\n",
      "71 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "70 botttles of beer on the wall.\n",
      "70 botttles of beer on the wall.\n",
      "70 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "69 botttles of beer on the wall.\n",
      "69 botttles of beer on the wall.\n",
      "69 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "68 botttles of beer on the wall.\n",
      "68 botttles of beer on the wall.\n",
      "68 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "67 botttles of beer on the wall.\n",
      "67 botttles of beer on the wall.\n",
      "67 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "66 botttles of beer on the wall.\n",
      "66 botttles of beer on the wall.\n",
      "66 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "65 botttles of beer on the wall.\n",
      "65 botttles of beer on the wall.\n",
      "65 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "64 botttles of beer on the wall.\n",
      "64 botttles of beer on the wall.\n",
      "64 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "63 botttles of beer on the wall.\n",
      "63 botttles of beer on the wall.\n",
      "63 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "62 botttles of beer on the wall.\n",
      "62 botttles of beer on the wall.\n",
      "62 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "61 botttles of beer on the wall.\n",
      "61 botttles of beer on the wall.\n",
      "61 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "60 botttles of beer on the wall.\n",
      "60 botttles of beer on the wall.\n",
      "60 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "59 botttles of beer on the wall.\n",
      "59 botttles of beer on the wall.\n",
      "59 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "58 botttles of beer on the wall.\n",
      "58 botttles of beer on the wall.\n",
      "58 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "57 botttles of beer on the wall.\n",
      "57 botttles of beer on the wall.\n",
      "57 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "56 botttles of beer on the wall.\n",
      "56 botttles of beer on the wall.\n",
      "56 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "55 botttles of beer on the wall.\n",
      "55 botttles of beer on the wall.\n",
      "55 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "54 botttles of beer on the wall.\n",
      "54 botttles of beer on the wall.\n",
      "54 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "53 botttles of beer on the wall.\n",
      "53 botttles of beer on the wall.\n",
      "53 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "52 botttles of beer on the wall.\n",
      "52 botttles of beer on the wall.\n",
      "52 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "51 botttles of beer on the wall.\n",
      "51 botttles of beer on the wall.\n",
      "51 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "50 botttles of beer on the wall.\n",
      "50 botttles of beer on the wall.\n",
      "50 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "49 botttles of beer on the wall.\n",
      "49 botttles of beer on the wall.\n",
      "49 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "48 botttles of beer on the wall.\n",
      "48 botttles of beer on the wall.\n",
      "48 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "47 botttles of beer on the wall.\n",
      "47 botttles of beer on the wall.\n",
      "47 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "46 botttles of beer on the wall.\n",
      "46 botttles of beer on the wall.\n",
      "46 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "45 botttles of beer on the wall.\n",
      "45 botttles of beer on the wall.\n",
      "45 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "44 botttles of beer on the wall.\n",
      "44 botttles of beer on the wall.\n",
      "44 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "43 botttles of beer on the wall.\n",
      "43 botttles of beer on the wall.\n",
      "43 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "42 botttles of beer on the wall.\n",
      "42 botttles of beer on the wall.\n",
      "42 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "41 botttles of beer on the wall.\n",
      "41 botttles of beer on the wall.\n",
      "41 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "40 botttles of beer on the wall.\n",
      "40 botttles of beer on the wall.\n",
      "40 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "39 botttles of beer on the wall.\n",
      "39 botttles of beer on the wall.\n",
      "39 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "38 botttles of beer on the wall.\n",
      "38 botttles of beer on the wall.\n",
      "38 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "37 botttles of beer on the wall.\n",
      "37 botttles of beer on the wall.\n",
      "37 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "36 botttles of beer on the wall.\n",
      "36 botttles of beer on the wall.\n",
      "36 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "35 botttles of beer on the wall.\n",
      "35 botttles of beer on the wall.\n",
      "35 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "34 botttles of beer on the wall.\n",
      "34 botttles of beer on the wall.\n",
      "34 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "33 botttles of beer on the wall.\n",
      "33 botttles of beer on the wall.\n",
      "33 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "32 botttles of beer on the wall.\n",
      "32 botttles of beer on the wall.\n",
      "32 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "31 botttles of beer on the wall.\n",
      "31 botttles of beer on the wall.\n",
      "31 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "30 botttles of beer on the wall.\n",
      "30 botttles of beer on the wall.\n",
      "30 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "29 botttles of beer on the wall.\n",
      "29 botttles of beer on the wall.\n",
      "29 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "28 botttles of beer on the wall.\n",
      "28 botttles of beer on the wall.\n",
      "28 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "27 botttles of beer on the wall.\n",
      "27 botttles of beer on the wall.\n",
      "27 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "26 botttles of beer on the wall.\n",
      "26 botttles of beer on the wall.\n",
      "26 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "25 botttles of beer on the wall.\n",
      "25 botttles of beer on the wall.\n",
      "25 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "24 botttles of beer on the wall.\n",
      "24 botttles of beer on the wall.\n",
      "24 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "23 botttles of beer on the wall.\n",
      "23 botttles of beer on the wall.\n",
      "23 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "22 botttles of beer on the wall.\n",
      "22 botttles of beer on the wall.\n",
      "22 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "21 botttles of beer on the wall.\n",
      "21 botttles of beer on the wall.\n",
      "21 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "20 botttles of beer on the wall.\n",
      "20 botttles of beer on the wall.\n",
      "20 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "19 botttles of beer on the wall.\n",
      "19 botttles of beer on the wall.\n",
      "19 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "18 botttles of beer on the wall.\n",
      "18 botttles of beer on the wall.\n",
      "18 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "17 botttles of beer on the wall.\n",
      "17 botttles of beer on the wall.\n",
      "17 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "16 botttles of beer on the wall.\n",
      "16 botttles of beer on the wall.\n",
      "16 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "15 botttles of beer on the wall.\n",
      "15 botttles of beer on the wall.\n",
      "15 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "14 botttles of beer on the wall.\n",
      "14 botttles of beer on the wall.\n",
      "14 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "13 botttles of beer on the wall.\n",
      "13 botttles of beer on the wall.\n",
      "13 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "12 botttles of beer on the wall.\n",
      "12 botttles of beer on the wall.\n",
      "12 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "11 botttles of beer on the wall.\n",
      "11 botttles of beer on the wall.\n",
      "11 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "10 botttles of beer on the wall.\n",
      "10 botttles of beer on the wall.\n",
      "10 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "9 botttles of beer on the wall.\n",
      "9 botttles of beer on the wall.\n",
      "9 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "8 botttles of beer on the wall.\n",
      "8 botttles of beer on the wall.\n",
      "8 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "7 botttles of beer on the wall.\n",
      "7 botttles of beer on the wall.\n",
      "7 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "6 botttles of beer on the wall.\n",
      "6 botttles of beer on the wall.\n",
      "6 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "5 botttles of beer on the wall.\n",
      "5 botttles of beer on the wall.\n",
      "5 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "4 botttles of beer on the wall.\n",
      "4 botttles of beer on the wall.\n",
      "4 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "3 botttles of beer on the wall.\n",
      "3 botttles of beer on the wall.\n",
      "3 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "2 botttles of beer on the wall.\n",
      "2 botttles of beer on the wall.\n",
      "2 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "No more bottles of beer of beer on the wall.\n"
     ]
    }
   ],
   "source": [
    "word = \"botttles\"\n",
    "for beer_num in range(99, 0, -1):\n",
    "    print(beer_num, word, \"of beer on the wall.\")\n",
    "    print(beer_num, word, \"of beer.\")\n",
    "    print(\"Take one down.\")\n",
    "    print(\"Pass it around.\")\n",
    "    if beer_num == 1:\n",
    "        print(\"No more bottles of beer of beer on the wall.\")\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottle\"\n",
    "        print(new_num, word, \"of beer on the wall.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7b39207b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": "1",
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
